package com.xishu.service;

import com.xishu.entity.activity.Activity;
import com.xishu.entity.comment.Comment;
import com.xishu.entity.shop.Praise;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class PraiseService {


    private CommonService commonService = CommonService.getInstance();

    public void savePraiseAndUpdateActivity(Praise praise, Activity activity) throws Exception {
        commonService.directSave(activity);
        commonService.createObject(praise);
    }

    public void savePraiseAndUpdateComment(Praise praise, Comment comment) throws Exception {
        commonService.directSave(comment);
        commonService.createObject(praise);
    }
}
